home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / usenet / sources / volume90 / rexx / mrnbst.ime / ReadMe < prev   
Text File  |  1990-03-04  |  4KB  |  106 lines

  1. 02/19/90  MRNBSTime - Set your clock by the National Bureau of Standards
  2.  
  3. This program got its inspiration from a program named "nbstime", written by
  4. Warren  Tucker.  The time conversion code is partly Warren's.  I thought it
  5. would  be  nice to have a similar capability on the Amiga.  In keeping with
  6. the  "small  and simple is better" philosophy, I didn't load it up with all
  7. of  the  serial  I/O stuff.  MRNBSTime gets its time value from an external
  8. file  (standard  input  or  filename parameter).  One would normally invoke
  9. MRNBSTime  from  a  terminal emulator script (as my example illustrates) or
  10. from  an  ARexx  program  which  has  access to a serial I/O resource (e.g.
  11. Larry  Phillips'  SerMod  package).   In  fact, I was so into the spirit of
  12. cooperating  tasks that MRNBSTime calls the Amiga's Date command to set the
  13. new system date.  Of course, some might suggest that I was just too lazy to
  14. write the Aztec-AmigaDOS date conversion routines :-). Naw! Well...
  15.  
  16. MRNBSTime  is  invoked  from  the CLI (or suitable scripting program).  Its
  17. command-line options are:
  18.  
  19.     MRNBSTime [ options ] [ filename ] or,
  20.     MRNBSTime [ options ] < filename or, if you use AShell and PIP:
  21.     someprogram | MRNBSTime [ -d delta ] (pipe it in!)
  22.  
  23. The options (which are optional if you live in Greenwich) may be one or both of these:
  24.  
  25.     -h hours    number of hours to add to GMT value (+- 12)
  26.     -m minutes  number of minutes to add to GMT value (+- 59);
  27.                 if specified, usually -30 or +30
  28.  
  29. These  delta  parameters allow you to specify your timezone delta from GMT.
  30. For instance, if you're in Rhode Island, your delta value (now, anyways) is
  31. -5.  This could very well be derived from an environment variable (probably
  32. should be).  Some examples:
  33.  
  34.     French Polynesia    -h -9 -m -30
  35.  
  36.     New England         -h -5 (Winter) (I wish they'd repeal this!)
  37.                         -h -4 (Summer)
  38.  
  39.     California          -h -8
  40.  
  41.     Greenwich, GB       (What are you looking for? :-)
  42.  
  43.     Iran                -h 3 -m 30
  44.  
  45.     Central Australia   -h 9 -m 30
  46.  
  47.  
  48. The contents of the input file look like this:
  49.  
  50. *
  51. 47941 050 212218 UTC
  52. *
  53. 47941 050 212219 UTC
  54. *
  55. 47941 050 212220 UTC
  56. *
  57. ^%$^#&Iax|+$^
  58. OK
  59.  
  60. It's  quite alright to have some garbage in the file.  As long as MRNBSTime
  61. can  recognize  one good line, all is well.  For the curious, the universal
  62. time code fields break out to:
  63.  
  64.     Julian Date
  65.     Day in the year
  66.     Time (HHMMSS) (GMT)
  67.     UTC = Magic recognizer cookie
  68.  
  69. The  auto-answer  modem (1200 baud) for the National Bureau of Standards is
  70. at 202-653-0351.
  71.  
  72. Enjoy!   I  am  placing this program in the public domain.  Do whatever you
  73. want  with  it.   One  caveat:   I will not be accountable for hugeamongous
  74. phone bills should you automate this and trust the supplied VT100 script to
  75. hang  up  properly.   I have a hunch that the line would drop automatically
  76. after some interval, but I haven't tried it.  Be careful!
  77.  
  78. Oh, by the way...  I created this using Manx Aztec C, V5.0.  I modified the
  79. declaration  of  "fexecl"  (in fcntl.h) to take a variable length parameter
  80. list:
  81.  
  82.         int fexecl(char *file, char *arg0, ... );
  83.  
  84. The Aztec includes are a little rough (new) and need a thorough grooming.
  85.  
  86. The VT100 script file requires VT100 release 2.9 and was originally written
  87. by   Tony  Sumrall  as  an  example  login  script.   To  use  the  example
  88. application, do the following:
  89.  
  90.     1. Copy MRNBSTime to a directory in your search path (e.g. C:).
  91.  
  92.     2. Copy MRNBSTime.vt100 to your Rexx: directory. If you're on the West
  93.        Coast or some other foreign land, you'll want to add the appropriate 
  94.        -d option to the script line that invokes the MRNBSTime.
  95.  
  96.     3. Start the VT100 emulator.
  97.  
  98.     4. Select "AREXX Macro" from the "Script" menu.
  99.  
  100.     5. Type "MRNBSTime" into the script name requester.
  101.  
  102.     6. Watch your Amiga become a time standard! :-)
  103.  
  104.  
  105. Mark Rinfret
  106.